package com.it.anno;


import com.it.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Target({ ElementType.FIELD})//元注解
@Retention(RetentionPolicy.RUNTIME)//元注解
@Documented//元注解
@Constraint(validatedBy = {StateValidation.class})//校验规则类
//自定义注解
public @interface State {

    //校验失败
    String message() default "State参数只能是已发布或者草稿";

    //分组
    Class<?>[] groups() default {};

    //负载 获取信息
    Class<? extends Payload>[] payload() default {};
}
